package com.wc.算法基础课.D第四讲数学知识.博弈论.剪纸游戏;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/4/16 14:57
 * @description https://www.acwing.com/problem/content/description/221/
 */
public class Main {
    /**
     * 思路：
     * 什么时候就输了, 就是说减到中途有 1 的时候就输了, 所以那个时候的sg = 0
     * 那么如何深度, 我们是可以改变长, 也可以改变宽的, 那我们肯定是从 2 开始找的吧, 那就可以试试, 如何寻找了
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 210;
    static int[][] f = new int[N][N];
    static int n, m;

    public static void main(String[] args) {
        for (int i = 0; i < N; i++) {
            Arrays.fill(f[i], -1);
        }
        while (sc.hasNext()) {
            n = sc.nextInt();
            m = sc.nextInt();
            if (n == 0 && m == 0) break;
            if (sg(n, m) > 0) out.println("WIN");
            else out.println("LOSE");
        }
        out.flush();
    }

    static int sg(int a, int b) {
        if (f[a][b] != -1) return f[a][b];
        Set<Integer> set = new HashSet<>();
        for (int i = 2; i <= a - 2; i++) {
            set.add(sg(i, b) ^ sg(a - i, b));
        }
        for (int i = 2; i <= b - 2; i++) {
            set.add(sg(a, i) ^ sg(a, b - i));
        }
        for (int i = 0; ; i++) {
            if (!set.contains(i)){
                f[a][b] = i;
                break;
            }
        }
        return f[a][b];
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
